<template>
  <div>
    <el-dialog title="版本详情" width="70%" :visible.sync="dialogVisible">
      <el-descriptions title="基本信息" :column="4">
        <el-descriptions-item label="排产流水号">1</el-descriptions-item>
        <el-descriptions-item label="订单编号">JN2356498</el-descriptions-item>
        <el-descriptions-item
          label="外协合同号"
        >OS1231546</el-descriptions-item>
        <el-descriptions-item label="优先级"> 1 </el-descriptions-item>
        <el-descriptions-item label="产品大类">被套类</el-descriptions-item>
        <el-descriptions-item label="业务员">张三</el-descriptions-item>
        <el-descriptions-item label="业务部门">业务一部</el-descriptions-item>
        <el-descriptions-item label="产品信息">**</el-descriptions-item>
        <el-descriptions-item label="订单需求量">650000</el-descriptions-item>
        <el-descriptions-item label="交期">2023/2/23</el-descriptions-item>
        <el-descriptions-item label="当前状态">排产完成</el-descriptions-item>
      </el-descriptions>
      <my-table :columns="settingColumns" :data="settingData">
        <template v-slot:action="{ row }">
          <el-button type="text">产线工序工时</el-button>
          <el-button type="text">除生产其他时间</el-button>
        </template>
      </my-table>
    </el-dialog>
  </div>
</template>

<script>
import myTable from '@/components/table/myTable'
export default {
  components: { myTable },
  props: {
    value: {
      type: Boolean,
      default: false
    },
    type: {
      type: [Number, String],
      default: '',
      required: false
    }
  },
  data() {
    return {
      dialogVisible: false,
      form: {},
      settingColumns: [
        {
          label: '批次序号',
          prop: 'name',
          fixed: true
        },
        {
          label: '批次交期',
          prop: 'batchDelivery'
        },
        {
          label: '批次交期',
          prop: 'batchDelivery'
        },
        {
          label: '批次排产量',
          prop: 'batchDelivery'
        },
        {
          label: '最早上线时间',
          prop: 'batchDelivery'
        },
        {
          label: '最晚上线时间',
          prop: 'endTime'
        },
        {
          label: '最早下线时间',
          prop: 'endTime'
        },
        {
          label: '最晚下线时间',
          prop: 'endTime'
        },
        {
          label: '总时差(天)',
          prop: 'endTime'
        },
        {
          label: '可生产时间(h)',
          prop: 'endTime'
        },
        {
          label: '加班时间(h)',
          prop: 'endTime'
        },
        {
          label: '瓶颈工序',
          prop: 'bottleneckProcess'
        },
        {
          label: '本厂可产量',
          prop: 'endTime'
        },
        {
          label: '实际排产量',
          prop: 'endTime'
        },
        {
          label: '流转数量(件)',
          prop: 'circulationQuantity'
        },
        {
          label: '流转次数(次)',
          prop: 'endTime'
        },
        {
          label: '单次流转制成时间(s)',
          prop: 'endTime'
        },
        {
          label: '订单制成周期',
          prop: 'endTime'
        },
        {
          label: '订单制成天数',
          prop: 'endTime'
        },
        {
          label: '操作',
          prop: 'action',
          slot: 'action',
          fixed: 'right',
          width: '300'
        }
      ],
      settingData: []
    }
  },
  watch: {
    value: {
      immediate: true,
      deep: true,
      handler(val) {
        if (val && val !== this.dialogVisible) {
          this.dialogVisible = val
          if (val) {
            //   this.selectRows = {}
            //   this.$refs?.table?.$refs?.myTable.setCurrentRow()
          }
        }
      }
    },
    dialogVisible(val) {
      this.$emit('input', val)
    }
  },
  created() {},
  mounted() {},
  methods: {
    handleClose() {
      this.dialogVisible = false
    }
  }
}
</script>

<style scoped lang="scss"></style>
